Five Nights in SRB2 plays similarly to Five Nights at Freddy's 2.

Use the flashlight (SPIN Button) to see oncoming animatronics in the hallway infront of you.
You may also use the flashlight in the cameras.

Mouse over the red bar to put on a face mask resembling Eggman.
Whenever an animatronic enters your office, put on the mask.

In the cameras, a music box can be wound up on CAM 11. do not let the box unwind completely,
or else whatever is inside the box will escape, eventually reaching your office.

Whenever you see the Deton in your hallway, hold your flashlight on it to fend it off.